/**
 * 
 */
package com.fwzc.giuseppe.activity;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.fwzc.giuseppe.R;
import com.fwzc.giuseppe.base.BaseActivity;

/**
 * 
 * 类名称：SettingActivity 类描述： 创建人：何琳 创建时间：2015年8月13日 下午2:07:56
 * 
 * @version
 * 
 */
public class SettingActivity extends BaseActivity implements OnClickListener {

	private RelativeLayout customerService, aboutUs, checkUpdate;// 联系客服,关于我们，检查跟新
	private TextView phonenum;// 客服电话

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.layout_setting);

		initBar();
		initView();
		initData();
	}

	private void initView() {
		customerService = (RelativeLayout) findViewById(R.id.rl_telphone);
		aboutUs = (RelativeLayout) findViewById(R.id.rl_aboutus);
		checkUpdate = (RelativeLayout) findViewById(R.id.rl_check_updates);
		phonenum = (TextView) findViewById(R.id.customer_service);
	}

	private void initData() {
		actionbar_side_name.setText("设置");
		iv_actionbar_side_left.setVisibility(View.VISIBLE);
		customerService.setOnClickListener(this);
		aboutUs.setOnClickListener(this);
		checkUpdate.setOnClickListener(this);
		iv_actionbar_side_left.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		if (v == customerService) {
			Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:"
					+ phonenum.getText().toString().trim()));// 客服电话
			intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
			startActivity(intent);
		} else if (v == aboutUs) {
			// 关于我们
			
		} else if (v == checkUpdate) {
			//检测最新版本
			Toast.makeText(this, "已是最新版本", Toast.LENGTH_SHORT).show();
		}else if (v == iv_actionbar_side_left) {
			finish();
		}

	}

}
